package handlers;

import java.awt.Color;
import java.awt.Dimension;
import java.util.ArrayList;

import javax.swing.*;

public class ListManager {
	//Colours
  	Color primary;
  	Color secondary;
  	Color selected;
	
	public ListManager() {
		primary = new Color(219,0,0);
    	secondary = new Color(246,191,191);
    	selected = new Color(122, 0, 0);
	
	}
	//Scene Setter
	public JPanel createItem() {
		JPanel item = new JPanel();
		
		pos = new JLabel[5];
		for(int i=0; i<5; ++i) {
			pos[i] = new JLabel();
		}
		// new Dimension(40, 40)
		item.setMaximumSize(new Dimension(950,30));
		item.setBackground(java.awt.Color.WHITE);
		
		GroupLayout itemLayout = new GroupLayout(item);
        item.setLayout(itemLayout);
        itemLayout.setHorizontalGroup(
            itemLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(itemLayout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addComponent(pos[0])
                .addGap(87, 87, 87)
                .addComponent(pos[1])
                .addGap(247, 247, 247)
                .addComponent(pos[2])
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 241, Short.MAX_VALUE)
                .addComponent(pos[3])
                .addGap(120, 120, 120)
                .addComponent(pos[4])
                .addGap(64, 64, 64))
        );
        itemLayout.setVerticalGroup(
        	itemLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(itemLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(itemLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(pos[0])
                    .addComponent(pos[1])
                    .addComponent(pos[2])
                    .addComponent(pos[3])
                    .addComponent(pos[4]))
                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        
        pos[0].setText("a");
        pos[1].setText("b");
        pos[2].setText("c");
        pos[3].setText("d");
        pos[4].setText("e");
        
        return item;
	}
	
	public JPanel addSpace() {
		JPanel space = new JPanel();
		space.setMaximumSize(new Dimension(950,5));
		space.setBackground(secondary);
		
		return space;
	}
	
	
	
	//TODO components
	private JLabel[] pos;
	//Lists
	private ArrayList<JPanel> ventas;
	private ArrayList<JPanel> inventario;
	private ArrayList<JPanel> clientes;
	private ArrayList<JPanel> proveedores;
	private ArrayList<JPanel> tiendas;
	private ArrayList<JPanel> bodegas;
	private ArrayList<JPanel> usuarios;
}
